
<?php

$style = "
h2{color:#cc5302;text-align:center;font-family: Arial;}
table
{
font-family: Arial;
border-collapse:collapse;
}

th{background-color:#e4ebf2;color:#12537f;}
table th,
table td {
	border: 1px solid #acbed4;
	padding: 3px 10px;
	font-size: 12px;
}

table th {
	background: #e4ebf2;
	color: #12537f;
	font-weight: bold;
}
#TENCTY{
font-size:13px;
width: 300px;
float:left; 
color: #12537f;
font-weight: bold;text-align:center;font-family: Arial;
}
#TENCTY span{
 margin: auto;
}
.clr{
clear:both;
}
.right{
text-align: right;
}
h3{font-size:14px;color:#cc5302;text-align:center;margin-top:-10px;}
p{font-size:13px;line-height:18px;}
";
$mpdf->WriteHTML($style, 1);
$html = "<DIV ID='TENCTY'> <span>CÔNG TY TNHH 2 THÀNH VIÊN</span><BR>";
$html.="<span>AIOGROUP2</span> </DIV> <div class='clr'></div>";
$html .= "<h3>Thông tin chi tiết mua hàng </h3>  <p> Số hóa đơn:" . $so_hoadon . "</p>"
        . "<p>  Thông tin người nhận:  $hoten . Địa chỉ: $diachi </p>";


$html.="<table  style='width:100%' >
    <tr> 
        <th width='16%'>Mã Sản Phẩm</th>
        <th width='37%'>Tên Sản Phẩm</th>
        <th width='12%'>Số Lượng</th>
        <th width='15%'>Đơn Giá</th>
        <th width='20%'>Thành Tiền</th>
    </tr>";
$tien = 0;
foreach ($cthd as $items) {
    $thanhtien = $items['sl'] * $items['dongia'];
    $html.="<tr> <td> " . $items['matp'] . "</td> ";
    $html.=" <td> " . $items['tentp'] . "</td> ";
    $html.=" <td class='right' > " . $items['sl'] . "</td> ";
    $html.=" <td class='right' > " . $this->cart->format_number($items['giaban']) . "</td> ";
    $html.=" <td class='right' >  " . $this->cart->format_number($thanhtien) . "</td> </tr>";
    $tien+=$thanhtien;
}
$html.="<tr> <td colspan='2'>Tổng Tiền</td><td colspan='3' class='right' > " . $this->cart->format_number($tien) . "  VNĐ</td> </tr>";
$html.="</table>";
$html.="<p>
                Tổng tiền: <strong style = 'color: blue;font-weight: bold;'>" . $this->cart->format_number($tien) . "VNĐ</strong>
                    </p>";
$mpdf->WriteHTML($html);
$mpdf->Output("file/mpdf.pdf", 'I');
?>
